from time import time
f = open("m1_sorted.txt", "r")
a = f.readlines()
f.close()
for i in range(len(a)):
    a[i] = int(a[i])

start_time = time()
for i in range(len(a) - 1):
    is_storted = True
    for j in range(len(a) - i - 1):
         if a[j] > a[j + 1]:
             a[j], a[j + 1] = a[j +1], a[j]
             is_storted = False
    if is_storted:
        break
end_time = time()
print((end_time - start_time) * 1000, "мс")





from time import time
f = open("m2_reverse.txt", "r")
a = f.readlines()
f.close()
for i in range(len(a)):
    a[i] = int(a[i])

start_time = time()
for i in range(len(a) - 1):
    is_storted = True
    for j in range(len(a) - i - 1):
         if a[j] > a[j + 1]:
             a[j], a[j + 1] = a[j +1], a[j]
             is_storted = False
    if is_storted:
        break
end_time = time()
print((end_time - start_time) * 1000, "мс")






from time import time
f = open("m3_shuffle.txt", "r")
a = f.readlines()
f.close()
for i in range(len(a)):
    a[i] = int(a[i])

start_time = time()
for i in range(len(a) - 1):
    is_storted = True
    for j in range(len(a) - i - 1):
         if a[j] > a[j + 1]:
             a[j], a[j + 1] = a[j +1], a[j]
             is_storted = False
    if is_storted:
        break
end_time = time()
print((end_time - start_time) * 1000, "мс")
